home *** CD-ROM | disk | FTP | other *** search
- Path: heydan.tiac.net!user
- From: heydan@tiac.net (Dan Winkler)
- Newsgroups: comp.lang.java,comp.lang.c++,comp.lang.smalltalk
- Subject: Telescript Networking (was Re: Advice to Java proponents)
- Date: Thu, 18 Apr 1996 22:26:14 -0400
- Organization: The Internet Access Company
- Message-ID: <heydan-1804962226140001@heydan.tiac.net>
- References: <315BFB16.B74@isg.de> <4jgv6t$hon@kadath.zeitgeist.net> <4k3cdo$np5@taurus.adnc.com> <DpG1s1.GC9@research.att.com> <4k71f5$ot5@news2.ios.com> <31684F33.2528@ibm.net> <denatale-0804960926250001@grail1213.nando.net> <316DA213.767B@vdc.smos.com> <316E2AD0.17C3@concentric.net>
- NNTP-Posting-Host: heydan.tiac.net
- X-Newsreader: Yet Another NewsWatcher 2.1.8
-
- > Proud of the networking functions in the Java library, are we?
- > VisualWorks Smalltalk has had such for quite a while now.
- > ...smalltalk example deleted...
- > I wonder how easy this stuff is in Telescript?
-
- Alan, I forwarded your question about Telescript to General Magic and
- got the following reply from Rory Ward. --Dan
-
-
- Here is a similar example to the Smalltalk example given.
-
- Since Telescript is all about distributed programming, all the network
- infrastructure is built directly into language. Telescript provides a high
- level of network abstraction, so you don't need to worry about sockets or
- flattening data or what byte means what. Telescript allows objects and code to
- travel around the network. Agents are a type of Telescript process that can
- 'go' around the network. Places are a different type of Telescript process
- that host agents. Effectively, agents are clients and places are servers.
- Programmers subclass agents and places as they see fit. When an agents go, its
- complete state and optionally its class is transmitted across the network on a
- secure, authenticated connection. And I don't need to worry about the remote
- engine coming down, because Telescript objects (including processes) are
- automatically persisted. When the engine is brought back up, I'll continue
- from where I stopped.
-
- An agent that goes to a remote host to get the time:
-
- // TimeAgent is a subclass of Agent. Agent's can roam the network. Cool
- TimeAgent: class(Agent) = (
- public
- // The host and port of the destination Telescript Engine I am going to
- host: String; port: Integer;
-
- // initialize my host and port and escalate to my superclass
- initialize:
- op(host: copied String; port: Integer;
- Permit; Permit|Nil; Integer|Nil; OctetString|Nil) = { ^; };
-
- // Specialize my live method. This is may main(). Every Telescript
- // process has its own thread of execution
- live:
- sponsored op(ex: Exception|Nil) =
- {
- // Create the ticket to where I'm going. The Way says I should
- // use TCP to travel to my destination
- // The nils mean I don't care what place I end up in.
- // The destination engine will choose what place I will end up
- // (at the discretion of the place)
- ticket:= Ticket(nil, nil, nil, nil, Way(nil, TCPMeans(port, host)));
-
- // Make sure we can catch an exception while travelling
- try {
-
- // Go to the remote site. It's as simple as one operation.
- // Everything (properties, class, run stack) gets packed up
- // and I am transferred through an authenticated connection
- // to my destination
- *.go(ticket);
-
- // I am now at the remote site. What time is it ??
- Time().dump();
- }
- // If the remote site isn't available, I get a TripException
- catch TripException { "Couldn't get there".dump(); };
- };
- );
-
- /Rory
- Rory Ward
- General Magic Inc
- rory_ward@genmagic.com
-